package homework.day02;

import java.io.*;

/**
 * @Classname: HomeWork01
 * @Author: bromide
 * @CreateTime: 2022/4/1--18:26
 * @Version: V1.0
 * @Description: 改正下面程序的错误
 * <p>
 * 程序实现需求:使用缓冲流完成文件的复制操作
 */
public class HomeWork01 {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("test.txt");
        //类名拼写不对
        BufferedInputStream bis = new BufferedInputStream(fis);


        FileOutputStream fos = new FileOutputStream("test_cp.txt");
        //应当创建缓冲字节输出流
        BufferedOutputStream bos = new BufferedOutputStream(fos);


        int d;
        while ((d = bis.read()) != -1) {
            bos.write(d);
        }
        System.out.println("复制完毕!");
        bos.close();
        bis.close();
    }
}
